home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch18 / rtrace / scn2sff.txt < prev    next >
Text File  |  1994-02-01  |  25KB  |  853 lines

  1.  
  2.  
  3. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  4.  
  5.  
  6. NAME
  7.      scn2sff - format conversion program
  8.  
  9. SYNOPSIS
  10.      scn2sff [options] {SCNfile|-} [>SFFfile]
  11.  
  12. AUTHOR
  13.      Antonio Costa, INESC-Norte, 1991 1993
  14.  
  15. DESCRIPTION
  16.      scn2sff command performs conversion between a text format (SCN)  suitable
  17.      -------
  18.      for  scene  descriptions to another more simple text format (SFF) that is
  19.      accepted by the rtrace ray-tracer program.  The SCN text  file  describes
  20.                      ------
  21.      objects, lights, surface definitions, textures, etc.  The scene format is
  22.      described bellow.
  23.  
  24. OPTIONS
  25.      [C]
  26.      The parameter C tells the program to preprocess the  input  file  through
  27.                    -
  28.      the UNIX standard preprocessor (/usr/lib/cpp with option -P).
  29.  
  30.      [M]
  31.      The parameter M tells the program to preprocess the  input  file  through
  32.                    -
  33.      the M4 preprocessor (/usr/bin/m4).
  34.  
  35.      [P"preprocessor command"]
  36.         ------------ -------
  37.      The parameter P tells the program to preprocess the  input  file  through
  38.                    -
  39.      the command described (for example, P"/usr/lib/cpp -P -Dabc").
  40.  
  41.      [+Oobjects]
  42.         -------
  43.      The parameter +O defines the maximum number of objects  to  use  (default
  44.                     -
  45.      25000).
  46.  
  47.      [+Llights]
  48.         ------
  49.      The parameter +L defines the maximum number of  lights  to  use  (default
  50.                     -
  51.      12).
  52.  
  53.      [+Ssurfaces]
  54.         --------
  55.      The parameter +S defines the maximum number of surfaces to  use  (default
  56.                     -
  57.      512).
  58.  
  59.      [+Ttextures]
  60.         --------
  61.      The parameter +T defines the maximum number of textures to  use  (default
  62.                     -
  63.      64).
  64.  
  65.      [+Mtransforms]
  66.         ----------
  67.      The parameter +M defines the maximum number  of  transformations  to  use
  68.                     -
  69.      (default 64).
  70.  
  71. RESTRICTIONS
  72.      None for the moment.
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.                                 October, 1993                                1
  81.  
  82.  
  83.  
  84. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  85.  
  86.  
  87. BUGS
  88.      No bugs known.  They have to be hidden deep somewhere, as usual.
  89.  
  90. DESCRIPTION
  91.      Comments start with % ; or # characters and continue to the  end  of  the
  92.      line (so there are no nested comments).
  93.  
  94.      The commands are processed from the start of the scene, and some  have  a
  95.      global  effect  until  they  are  changed  or the scene is complete. Such
  96.      commands  are  refraction,  surface,  transformations  and  textures;  as
  97.                     ----------   -------   ---------------       --------
  98.      commands can be nested by grouping, any command defined inside a group is
  99.      removed when that group is finished.
  100.  
  101.      Example:
  102.  
  103.      surface matte white        % current surface is matte white
  104.      refraction 1.1             % current refraction index
  105.      transform rotate x 15      % transformation
  106.      group                      % start of a group of commands
  107.        surface matte red        % new current surface
  108.        transform scale 2        % transformation
  109.        sphere 0 0 0 1           % sphere object
  110.      ungroup                    % end of group
  111.      % back to matte white surface, refraction 1.1
  112.      % scale transformation is removed
  113.  
  114.                          ENTITIES
  115.  
  116.      The main entities are:
  117.  
  118.      integer - it can be a simple number, an integer  expression  enclosed  in
  119.      -------
  120.      parenthesis or the int function applied to any real expression.
  121.                         ---
  122.  
  123.      real - a number, a function or an expression enclosed in parenthesis.
  124.      ----
  125.  
  126.      color - a triplet of RGB real values between 0 and 1 (in  certain  cases,
  127.      -----
  128.      it is allowed to be greater than 1 or negative; called color_extended) or
  129.                                                             ----- --------
  130.      a name (like red, blue, etc).
  131.                   ---  ----
  132.  
  133.      point - a triplet of XYZ values (numbers, functions or expressions).
  134.      -----
  135.  
  136.      vector - similar to point, but the 3 components cannot be  simultaneously
  137.      ------
  138.      equal to 0.
  139.  
  140.      filename - a set of characters with no blanks between.
  141.      --------
  142.  
  143.      expression - anything enclosed in parenthesis. Operators are +, -, *,  /,
  144.      ----------
  145.      ^ (exponentiation) and | (remainder).
  146.  
  147.      function - there are many functions available: int sin cos tan asin  acos
  148.      --------                                       --- --- --- --- ----  ----
  149.      atan  sqrt  rtod dtor exp log abs max min. There also some functions that
  150.      ----  ----  ---- ---- --- --- --- --- ---
  151.      operate with vectors and return a number (dotvector) and some that return
  152.                                                ---------
  153.      a   vector   or   point   (normvector  addvector  diffvector  scalevector
  154.                                 ----------  ---------  ----------  -----------
  155.      crossvector).  There is also an operator mono that converts from a  value
  156.      -----------                              ----
  157.      to 3 identical values (good for specifying monochromatic colors).
  158.  
  159.  
  160.  
  161.                                 October, 1993                                2
  162.  
  163.  
  164.  
  165. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  166.  
  167.  
  168.                          GENERAL COMMANDS
  169.  
  170.      The main commands are:
  171.  
  172.      eye (from) point - default {5,0,0}.
  173.      ---  ----
  174.  
  175.      look (at) point - default {0,0,0}.
  176.      ----  --
  177.  
  178.      up vector - default {0,1,0}.
  179.      --
  180.  
  181.      angle (fov)  horizontal  [vertical]  -  half  aperture  view  in  degrees
  182.      -----  ---
  183.      (default 22.5 degrees).
  184.  
  185.      background color - the color of  the  background,  at  infinite  distance
  186.      ----------
  187.      (default light_sky_blue).
  188.  
  189.      ambient color - the  diffuse  light  that  illuminates  the  whole  scene
  190.      -------
  191.      (default is {0.1,0.1,0.1}).
  192.  
  193.      refraction (ior) index - default is 1.
  194.      ----------  ---
  195.  
  196.      group ... ungroup - anything enclosed is only defined inside  the  block,
  197.      -----     -------
  198.      ie, it does not apply outside.
  199.  
  200.                          LIGHT COMMANDS
  201.  
  202.      The commands for definition of light sources are:
  203.  
  204.      light point point [color_extended] - default color for lights is white.
  205.      ----- -----
  206.  
  207.      light directional vector [color].
  208.      ----- -----------
  209.  
  210.      light spot point vector  color_extended  [angle  [factor]]  -  the  light
  211.      ----- ----
  212.      illuminates  inside  a cone defined by the angle (default 45 degrees) and
  213.      the transition can be sharp if factor is near 1 or smooth if factor >>  1
  214.      (default 1).
  215.  
  216.      light extended point color_extended radius samples -  a  spherical  light
  217.      ----- --------
  218.      (it is sampled by samples^2 rays).
  219.  
  220.      light linear point color_extended vector samples - a linear light (it  is
  221.      ----- ------
  222.      sampled by samples rays).
  223.  
  224.      light planar point color_extended vector1 vector2 samples1 samples2  -  a
  225.      ----- ------
  226.      planar  light  (it is sampled by samples1*samples2 rays).  The light area
  227.      is defined by the two vectors.
  228.  
  229.                          SURFACE COMMANDS
  230.  
  231.      The commands for definition of surfaces are:
  232.  
  233.      surface color [diffusion specularity phong  metalness  [transparency]]  -
  234.      -------
  235.      phong   and  metalness  are  values,  the  others  are  colors  (defaults
  236.      {0.9,0.9,0.9}  {0.1,0.1,0.1}  3  0  {0.1,0.1,0.1}  or  transparency  only
  237.      {0,0,0}).
  238.  
  239.  
  240.  
  241.                                 October, 1993                                3
  242.  
  243.  
  244.  
  245. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  246.  
  247.  
  248.      surface strauss color smoothness metalness [transparency]  -  all  colors
  249.      ------- -------
  250.      (default transparency is {0,0,0}).
  251.  
  252.      surface matte color - all diffuse surface.
  253.      ------- -----
  254.  
  255.      surface plastic color smoothness phong  -  surface  with  big  diffusion,
  256.      ------- -------
  257.      small specularity and small phong factor.
  258.  
  259.      surface metal color smoothness phong - surface with small diffusion,  big
  260.      ------- -----
  261.      specularity, big phong factor and metalness factor equal to 1.
  262.  
  263.      surface dielectric color transparency refraction  -  transparent  surface
  264.      ------- ----------
  265.      with  no  diffusion,  some  specularity,  large  phong  factor  and  null
  266.      metalness.
  267.  
  268.      surface glass color transparency - transparent  surface  with  refraction
  269.      ------- -----
  270.      index equal to 1.52, approximately.
  271.  
  272.      There are two keywords that affect the surface appearance; they  must  be
  273.      placed immediately after the surface keyword:
  274.                                   -------
  275.  
  276.      emitter - the surface glows.
  277.      -------
  278.  
  279.      noshadow - the surface has no shadows from other objects.
  280.      --------
  281.  
  282.                          OBJECT COMMANDS
  283.  
  284.      The commands for objects are of the form
  285.           object object_data
  286.           ------
  287.      or else with local commands that apply only to itself of the form
  288.           object [attributes ... data] object_data.
  289.           ------                 ----
  290.  
  291.      sphere center radius.
  292.      ------
  293.  
  294.      box center sizes - this is an axis-aligned box.
  295.      ---
  296.  
  297.      cube center size - again it is axis-aligned.
  298.      ----
  299.  
  300.      cone apex base base_radius - closed cone.
  301.      ----
  302.  
  303.      cone open apex base base_radius.
  304.      ---- ----
  305.  
  306.      cylinder apex base radius - closed cylinder.
  307.      --------
  308.  
  309.      cylinder open apex base radius.
  310.      -------- ----
  311.  
  312.      cone truncated apex apex_radius base base_radius - closed.
  313.      ---- ---------
  314.  
  315.      cone truncated open apex apex_radius base base_radius.
  316.      ---- --------- ----
  317.  
  318.      wedge point point point depth - defined by a triangular  face  and  depth
  319.      -----
  320.      (face  is  defined  counterclockwise  so  that  depth  is measured in the
  321.      opposite direction of Rigth Hand Rule thumb; this convention also applies
  322.      to other objects).
  323.  
  324.  
  325.  
  326.  
  327.                                 October, 1993                                4
  328.  
  329.  
  330.  
  331. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  332.  
  333.  
  334.      tetra point point point point.
  335.      -----
  336.  
  337.      prism depth number_vertices point ... point - closed prism.
  338.      -----
  339.  
  340.      prism open depth number_vertices point ... point.
  341.      ----- ----
  342.  
  343.      pyramid depth number_vertices point ... point - closed pyramid.
  344.      -------
  345.  
  346.      pyramid open depth number_vertices point ... point.
  347.      ------- ----
  348.  
  349.      pyramid truncated open depth apex_scale number_vertices point ... point -
  350.      ------- --------- ----
  351.      it  is  an open pyramid with the apex scaled by apex_scale in relation to
  352.      its base (if 0 it is an open pyramid, if 1 it is a prism).
  353.  
  354.      disc center normal radius.
  355.      ----
  356.  
  357.      ring center normal outer_radius inner_radius.
  358.      ----
  359.  
  360.      patch point ... point (12) - a bicubic patch is defined  by  its  corners
  361.      -----
  362.      and 8 exterior points, arranged in this manner:
  363.                        11  12
  364.                      7  8  9  10
  365.                      3  4  5  6
  366.                         1  2
  367.      Normal points according to Right Hand Rule using corners 4-5-9-8.
  368.  
  369.      patch file [point [point]] filename - a group  of  patches  stored  in  a
  370.      ----- ----
  371.      file; first point is a translation and second is a scale.
  372.  
  373.      polygon number_vertices point ... point - a polygon (can be concave,  but
  374.      -------
  375.      does not have holes).
  376.  
  377.      polygon file [point [point]] filename - a group of polygons stored  in  a
  378.      ------- ----
  379.      file; first point is a translation and second is a scale.
  380.  
  381.      triangle point point point.
  382.      --------
  383.  
  384.      quadrangle point point point point.
  385.      ----------
  386.  
  387.      triangle normal point vector point vector point vector - a triangle  with
  388.      -------- ------
  389.      normals in its vertices.
  390.  
  391.      triangle normal file point point filename - a  group  of  triangles  with
  392.      -------- ------ ----
  393.      normals  in  the  vertices stored in a file; first point is a translation
  394.      and second is a scale.
  395.  
  396.      triangle general point vector  point  vector  point  vector  surface  ...
  397.      -------- -------
  398.      surface  ...  surface  ...  - a triangle with normals and surfaces in its
  399.      vertices.
  400.  
  401.      triangle general file point point filename - a group  of  triangles  with
  402.      -------- ------- ----
  403.      normals  and  surfaces in the vertices stored in a file; first point is a
  404.      translation and second is a scale.
  405.  
  406.  
  407.  
  408.  
  409.  
  410.                                 October, 1993                                5
  411.  
  412.  
  413.  
  414. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  415.  
  416.  
  417.      torus outer_radius section_radius  start_angle  end_angle  [outer_samples
  418.      -----
  419.      section_samples]  - A closed torus is centered in {0,0,0} and lies in the
  420.      XZ plane. 0 degrees is  in  the  X  direction  and  the  angle  increases
  421.      counterclockwise.
  422.  
  423.      torus   open   outer_radius    section_radius    start_angle    end_angle
  424.      -----   ----
  425.      [outer_samples section_samples] - An open torus.
  426.  
  427.      text3d file filename - a group of text primitives stored in a file;  each
  428.      ------ ----
  429.      primitive  is  described  by lines and arcs and is extruded (similar to a
  430.      prism, in a certain way).
  431.  
  432.      csg begin - start of a CSG primitive, ie, left component.
  433.      ---
  434.  
  435.      csg next - right component of a CSG primitive.
  436.      ---
  437.  
  438.      csg end - end of a CSG primitive.
  439.      ---
  440.  
  441.      list begin - start of a list primitive (no nesting allowed).
  442.      ----
  443.  
  444.      list end - end of a list primitive.
  445.      ----
  446.  
  447.                          TRANSFORMATION COMMANDS
  448.  
  449.      A transformation may be defined globaly or inside  a  block,  and  it  is
  450.      post-concatenated  with previous transformations. If inside a block, when
  451.      the block  is  terminated  the  transformations  defined  inside  it  are
  452.      removed.  Also,  when  a  transformation  is an attribute of an object or
  453.      texture it only exists for that entity.
  454.  
  455.      transform none - removes all transformations.
  456.      --------- ----
  457.  
  458.      transform scale factor [factor factor].
  459.      --------- -----
  460.  
  461.      transform translate point.
  462.      --------- ---------
  463.  
  464.      transform rotate x angle.
  465.      --------- ------ -
  466.  
  467.      transform rotate y angle.
  468.      --------- ------ -
  469.  
  470.      transform rotate z angle.
  471.      --------- ------ -
  472.  
  473.      transform rotate axis angle.
  474.      --------- ------
  475.  
  476.      transform general point point point [point].
  477.      --------- -------
  478.  
  479.                          TEXTURE COMMANDS
  480.  
  481.      A texture is basically a modification of the surface  characteristics  of
  482.      an  object, a modification of the normal vector in the intersection point
  483.      or the modification of the intersection point itself. It is  possible  to
  484.      apply  transformations  to  textures, and even keep them independent from
  485.      the object transformations.
  486.  
  487.  
  488.  
  489.  
  490.  
  491.                                 October, 1993                                6
  492.  
  493.  
  494.  
  495. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  496.  
  497.  
  498.      texture none - remove all defined textures.
  499.      ------- ----
  500.  
  501.      texture scale factor [factor factor].
  502.      ------- -----
  503.  
  504.      texture translate point.
  505.      ------- ---------
  506.  
  507.      texture rotate x angle.
  508.      ------- ------ -
  509.  
  510.      texture rotate y angle.
  511.      ------- ------ -
  512.  
  513.      texture rotate z angle.
  514.      ------- ------ -
  515.  
  516.      texture rotate axis angle.
  517.      ------- ------
  518.  
  519.      texture general point point point [point].
  520.      ------- -------
  521.  
  522.      texture local - generate all the transformations necessary to access  the
  523.      ------- -----
  524.      object   directly,   without   considering   any  object  transformations
  525.      previously defined.
  526.  
  527.      checkers surface [transform] - a chessboard-like pattern of  the  current
  528.      --------
  529.      surface and the defined surface.
  530.  
  531.      blotch scale surface [filename] [transform] - A spray-like mixture  of  2
  532.      ------
  533.      surfaces  (the  current and the defined). The scale controls the mixture.
  534.      If a filename is given, it is interpreted as a color palette, and it must
  535.      contain  256 triplets of RGB values in the range 0 to 255 (this format is
  536.      equal for all  the  textures  that  have  a  filename  parameter,  except
  537.                                                   --------
  538.      imagemap).
  539.      --------
  540.  
  541.      bump scale [transform] - A normal-modifying texture.
  542.      ----
  543.  
  544.      marble [filename] [transform] - A marble-like texture.
  545.      ------
  546.  
  547.      fbm offset scale omega lambda threshold octaves [filename] [transform]  -
  548.      ---
  549.      A fractal brownian motion texture that changes diffusion and specularity.
  550.  
  551.      fbmbump offset scale lambda octaves [transform] - a texture that modifies
  552.      -------
  553.      the normal.
  554.  
  555.      wood color [transform] - A  texture  imitating  wood  (default  color  is
  556.      ----
  557.      brown).
  558.      -----
  559.  
  560.      round scale [transform] - strange texture  that  modifies  diffusion  and
  561.      -----
  562.      specularity.
  563.  
  564.      bozo turbulence [filename] [transform].
  565.      ----
  566.  
  567.      ripples frequency phase scale  [transform]  -  a  texture  that  imitates
  568.      -------
  569.      ripples (small sinusoidal perturbations of the surface).
  570.  
  571.      waves frequency phase scale [transform] - a texture  like  waves  (multi-
  572.      -----
  573.      interfering sinusoidal perturbations of the surface).
  574.  
  575.  
  576.  
  577.  
  578.  
  579.                                 October, 1993                                7
  580.  
  581.  
  582.  
  583. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  584.  
  585.  
  586.      spotted [filename] [transform] - small color spots.
  587.      -------
  588.  
  589.      dents scale [transform] - small  modifications  of  normal  that  imitate
  590.      -----
  591.      dents.
  592.  
  593.      agate [filename] [transform].
  594.      -----
  595.  
  596.      wrinkles [transform] - a texture that modifies normal imitating wrinkles.
  597.      --------
  598.  
  599.      granite [filename] [transform].
  600.      -------
  601.  
  602.      gradient turbulence  direction  [filename]  [transform]  -  This  texture
  603.      --------
  604.      produces a variation of color following direction given.
  605.  
  606.      imagemap turbulence mode u_axis v_axis filename [transform] -  An  image-
  607.      --------
  608.      mapping  texture.  Mode  parameter  controls  tiling  of  texture (0-yes,
  609.      nonzero-no).  The u_axis and v_axis specify  the  internal  texture  axis
  610.      from  the  3D axis (1-X, 2-Y, 3-Z).  A filename must be given, because it
  611.      is the image that will be drawn on the surface (the format of  the  image
  612.      is the rtrace format PIC).
  613.             ------
  614.  
  615.      gloss scale [transform] - Glossy-like  texture  that  changes  diffusion,
  616.      -----
  617.      specularity and phong factor.
  618.  
  619.      bump3 scale  size  [transform]  -  A  normal-modifying  texture.  Changes
  620.      -----
  621.      intersection point, so may produce strange results!
  622.  
  623. EXAMPLES
  624.      Here are some simple examples:
  625.  
  626.      %%%%% example 1
  627.      % light source
  628.      light point 4 3 1
  629.      % surface
  630.      surface matte red
  631.      sphere 0 0 0 1
  632.      % another surface (replaces previous)
  633.      surface plastic blue mono 0.3 0.3
  634.      sphere 3 -0.4 0.4 0.2
  635.      % another surface
  636.      surface plastic yellow mono 0.9 0.9
  637.      % transformations for next object(s)
  638.      transform rotate y rtod(atan(1))
  639.      transform translate 3 -0.4 -0.4
  640.      box 0 0 0 0.1 0.1 0.3
  641.      % remove previous transformation(s)
  642.      transform none
  643.      % another surface
  644.      surface green mono 0.8 mono 0.2 10 0.3
  645.      cone 3 0.1 0 3 -0.4 0 0.2
  646.      surface matte white
  647.      csg subtraction begin
  648.          sphere 0 0 0 1
  649.          csg next
  650.          box 0 0 0 1.1 0.4 0.4
  651.      csg end
  652.  
  653.  
  654.                                 October, 1993                                8
  655.  
  656.  
  657.  
  658. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  659.  
  660.  
  661.      This example is correct, although it does not take full usage of SCN, ie,
  662.      the capability of defining locally the attributes. It could be rewritten:
  663.  
  664.      %%%%% example 2
  665.      % light source
  666.      light point 4 3 1
  667.      % now all objects have local attributes
  668.      sphere
  669.          surface matte red
  670.          data 0 0 0 1
  671.      sphere
  672.          surface plastic blue mono 0.3 0.3
  673.          data 3 -0.4 0.4 0.2
  674.      box
  675.          surface plastic yellow mono 0.9 0.9
  676.          % local transformations
  677.          transform rotate y rtod(atan(1))
  678.          transform translate 3 -0.4 -0.4
  679.          % this object is defined in a local coords system
  680.          % the translation puts it in the right place
  681.          data 0 0 0 0.1 0.1 0.3
  682.      cone
  683.          surface green mono 0.8 mono 0.2 10 0.3
  684.          data 3 0.1 0 3 -0.4 0 0.2
  685.      csg subtraction surface matte white
  686.          data begin
  687.          sphere 0 0 0 1
  688.          csg next
  689.          box 0 0 0 1.1 0.4 0.4
  690.      csg end
  691.  
  692.      To produce an image from any of these examples,  the  example  should  be
  693.      stored in a file (suppose example.scn) and then execute
  694.                                ------- ---
  695.        scn2sff example.scn|rtrace w512 p2 A0.1 - example.pic
  696.      to create the image.  If the SCN  file  contained  any  cpp  preprocessor
  697.                                                              ---
  698.      directives, then
  699.        scn2sff C example.scn|rtrace w512 p2 A0.1 - example.pic
  700.      would do.
  701.  
  702.      A complete demo example follows:
  703.      [Start]
  704.      % example to be traced with parameters like
  705.      % w512 p2 A0.1 t1 I1 - good quality
  706.      % or then
  707.      % w512 p3 A.05 t1 I1 j1 - very good quality
  708.  
  709.      %%%%% start
  710.      eye 5 2 2
  711.      fov 20
  712.      background light_sky_blue
  713.      ambient mono 0.2 % dark grey
  714.  
  715.      light point 3 5 4 white
  716.  
  717.      surface matte red % default surface
  718.  
  719.  
  720.  
  721.                                 October, 1993                                9
  722.  
  723.  
  724.  
  725. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  726.  
  727.  
  728.      %%%%% a simple CSG example
  729.      csg subtraction begin
  730.      % no attributes for this CSG, so it uses the attributes
  731.      % of its nodes...
  732.  
  733.        % left node
  734.        csg subtraction
  735.          % attributes of this CSG object
  736.          surface matte white
  737.          texture scale 0.2
  738.          checkers surface matte mono 0.3 translate 0.1 0.1 0.1
  739.          data begin
  740.  
  741.          box 0 0 0 1 1 1
  742.  
  743.        csg next
  744.  
  745.          box 0 0 0 1.01 0.5 0.5
  746.          cylinder 0 1.01 0 0 -1.01 0 0.5
  747.  
  748.        csg end
  749.  
  750.      csg next
  751.  
  752.        % right node
  753.        sphere 1 1 1 0.5 % default surface assumed
  754.        sphere 1 1 -1 0.5
  755.        sphere surface matte blue data 1 -1 1 0.5
  756.        sphere surface matte blue data 1 -1 -1 0.5
  757.  
  758.      csg end
  759.  
  760.      %%%%% some 3D text
  761.      text3d file surface matte yellow
  762.        data csg.t3d % data is in file
  763.  
  764.      %%%%% end
  765.      [End]
  766.  
  767.      The csg.t3d file contents could be:
  768.      [Start]
  769.      spacing 0.1
  770.      orientation 0 0 -1 0 1 0 1 0 0
  771.      encoding abc.ppe
  772.      font zurichcg.ppf
  773.      scale 0.4 0.4 0.2
  774.      at 1.25 1.5 1.6 "Antonio Costa"
  775.      font renfrew.ppf
  776.      scale 0.4 0.4 0.1
  777.      at 1.1 -0.85 1.1 "/copyright/1992"
  778.      at 1.1 -1.3 1.1 "INESCn"
  779.  
  780.      # there must be an empty line in the end
  781.      Description:
  782.      SPACING is letter spacing
  783.      ORIENTATION defines how the text appears
  784.  
  785.  
  786.                                October, 1993                                10
  787.  
  788.  
  789.  
  790. SCN2SFF(1G)                Unix Programmer's Manual                SCN2SFF(1G)
  791.  
  792.  
  793.       - 1st: text direction vector (left to right)
  794.       - 2nd: vertical vector
  795.       - 3rd: depth vector
  796.      ENCODING associates logical character names to glyph numbers
  797.      FONT is the file where the 2D glyphs are defined
  798.      SCALE controls scaling along ORIENTATION vectors
  799.      AT is baseline lower left position of text plus text (quoted)
  800.      [End]
  801.  
  802. HISTORY
  803.      Copyright (C) 1991, 1993 Antonio Costa.
  804.      Permission is granted to use this file  in  whole  or  in  part  for  any
  805.      purpose,  educational,  recreational  or  commercial,  provided that this
  806.      copyright notice is retained unchanged. This software is available to all
  807.      free of charge by anonymous FTP.
  808.  
  809.      12-Oct-93  Antonio Costa
  810.           Release 1.6.4
  811.           acc@asterix.inescn.pt
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.                                October, 1993                                11
  852.  
  853.